import { EChartsOption } from 'echarts'

export const lineOptions: EChartsOption = {
  title: {
    text: '月度交易金额',
    left: 'center'
  },
  xAxis: {
    data: [
      '一月',
      '二月',
      '三月',
      '四月',
      '五月',
      '六月',
      '七月',
      '八月',
      '九月',
      '十月',
      '十一月',
      '十二月'
    ],
    boundaryGap: false,
    axisTick: {
      show: false
    }
  },
  grid: {
    left: 40,
    right: 40,
    bottom: 20,
    top: 80,
    containLabel: true
  },
  tooltip: {
    trigger: 'axis',
    axisPointer: {
      type: 'cross'
    },
    padding: [5, 10]
  },
  yAxis: {
    axisTick: {
      show: false
    }
  },
  series: [
    {
      name: '交易金额',
      smooth: true,
      type: 'line',
      data: new Array(12).fill(0),
      animationDuration: 2800,
      animationEasing: 'cubicInOut'
    }
  ]
}

export const pieOptions: EChartsOption = {
  title: {
    text: '会员来源',
    left: 'center'
  },
  tooltip: {
    trigger: 'item',
    formatter: '{a} <br/>{b} : {c} ({d}%)'
  },
  series: [
    {
      name: '会员来源',
      type: 'pie',
      radius: '55%',
      center: ['50%', '60%'],
      data: [{ value: 0, name: 'unknown' }]
    }
  ]
}

export const barOptions: EChartsOption = {
  title: {
    text: '每周会员消费频次',
    left: 'center'
  },
  tooltip: {
    trigger: 'axis',
    axisPointer: {
      type: 'shadow'
    }
  },
  grid: {
    left: 50,
    right: 20,
    bottom: 20
  },
  xAxis: {
    type: 'category',
    data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
    axisTick: {
      alignWithLabel: true
    }
  },
  yAxis: {
    type: 'value'
  },
  series: [
    {
      name: '消费次数',
      data: new Array(7).fill(0),
      type: 'bar'
    }
  ]
}
